app.service('goodsBrandService',function ($http) {
    //全部品牌列表
    this.findAll=function(){
        return $http.get('../goodsBrandController/findAll.do');
    }
    //分页列表
    this.findPageList=function(pageNum,pageSize){
        return $http.get('../goodsBrandController/findPageList.do?pageNum='+pageNum +'&pageSize='+pageSize);
    }
    //添加商品
    this.addBrand=function (brand) {
        return $http.post('../goodsBrandController/addBrand.do',brand);
    }
    //更新商品
    this.updateBrand=function (brand) {
        return $http.post('../goodsBrandController/updateBrand.do',brand);
    }
    //查询单个品牌
    this.findOne=function (id) {
        return $http.get('../goodsBrandController/findOne.do?id='+id);
    }
    //删除品牌，可批量
    this.deleteBrand=function (selectedBrandId) {
        return $http.get('../goodsBrandController/deleteBrand.do?ids='+selectedBrandId);
    }
    //模糊查询并分页显示
    this.search=function (pageNum,pageSize,dpbrand) {
        return $http.post('../goodsBrandController/search.do?pageNum='+pageNum+'&pageSize='+pageSize,dpbrand);
    }
    //查询品牌 name 和 id，且 name 名为 test 返回
    this.selectBrandOption=function () {
        return $http.get("../goodsBrandController/selectBrandOption.do");
    }
});
